#include "Threadpool.hpp"
#include "Task.hpp"

using namespace ThreadPoolModule;

int main()
{
    ENABLE_CONSOLE_LOG();

    ThreadPool<task_t>::GetInstance()->Start();
    int cnt = 5;
    while (cnt)
    {
        ThreadPool<task_t>::GetInstance()->Equeue(Push);
        sleep(1);
        cnt--;
    }

    ThreadPool<task_t>::GetInstance()->Stop();
    sleep(3);

    ThreadPool<task_t>::GetInstance()->Wait();

    // ENABLE_CONSOLE_LOG();
    // std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();

    // tp->Start();
    // int cnt = 5;
    // while (cnt)
    // {
    //     tp->Equeue(Push);
    //     sleep(1);
    //     cnt--;
    // }

    // tp->Stop();
    // sleep(3);

    // tp->Wait();

    return 0;
}